﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;

namespace Tasker.WebUI.Models
{
    public class StaffModel
    {
        public int Id { get; set; }
        public string Login { get; set; }
        public string LastName { get; set; }
        public string FirstName { get; set; }
        public string Position { get; set; }
        public IEnumerable<string> Emails { get; set; }
        public IEnumerable<string> Phones { get; set; }

        public string FullName
        {
            get
            {
                if (FirstName == null && LastName == null)
                    return Login;
                return FirstName + " " + LastName;
            }
        }
    }

    public class StaffListModel
    {
        public IEnumerable<StaffModel> staff;
    }

    public class StaffShowModel
    {
        public string Login { get; set; }
        public string LastName { get; set; }
        public string FirstName { get; set; }
        public string Position { get; set; }
        public string Comment { get; set; }
        public IEnumerable<string> Emails { get; set; }
        public IEnumerable<string> Phones { get; set; }
        public string PictureName { get; set; }
        public string PictureType { get; set; }

        public string FullName
        {
            get
            {
                if (FirstName == null && LastName == null)
                    return Login;
                return FirstName + " " + LastName;
            }
        }

        public string PicturePath
        {
            get { return Tasker.Common.UrlHelper.GetUserPicturePath(PictureName, PictureType); }
        }

        public string PictureThumbPath
        {
            get { return Tasker.Common.UrlHelper.GetUserPictureThumbPath(PictureName, PictureType); }
        }
    }
}
